package com.huluobo.a2212mdmdemo.pages

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import com.huluobo.a2212mdmdemo.video.page.VideoPage
import com.huluobo.apps.pages.AppsPage
import com.huluobo.document.pages.DocumentPage
import com.huluobo.document.pages.LocalFilePage
import com.huluobo.lib_base.RoutePath
import com.huluobo.report.pages.ReportCommitPage
import com.huluobo.report.pages.ReportPage
import com.huluobo.sign.pages.SignCommitPage
import com.huluobo.sign.pages.SignListPage
import com.huluobo.user.pages.AddApprovePage
import com.huluobo.user.pages.AddEmployeePage
import com.huluobo.user.pages.ApproveListPage
import com.huluobo.user.pages.ApprovePage
import com.huluobo.user.pages.ComApproveListPage
import com.huluobo.user.pages.ComApprovePage
import com.huluobo.user.pages.LoginPage
import com.huluobo.user.pages.MinePage
import com.huluobo.user.pages.RegisterPage

/**
 *  Created by LC on 2025/5/27.
 *  声明页面的统一文件
 */

@Composable
fun MyNavHost(it: PaddingValues, navHostController: NavHostController) {
    NavHost(
        modifier = androidx.compose.ui.Modifier.padding(it),
        navController = navHostController,
        startDestination = RoutePath.HOME,
        builder = {
            composable(RoutePath.MESSAGE) { MessagePage(navHostController) }
            composable(RoutePath.HOME) { HomePage(navHostController) }
            composable(RoutePath.MINE) { MinePage(navHostController) }
            composable(RoutePath.APPS) { AppsPage(navHostController = navHostController) }
            composable(RoutePath.DOCUMENT) { DocumentPage(navHostController = navHostController) }
            composable(RoutePath.LOCAL) { LocalFilePage(navHostController = navHostController) }
            composable(RoutePath.REPORT) { ReportPage(navHostController = navHostController) }
            composable(RoutePath.REPORT_COMMIT + "/{report}") {
                val report = it.arguments?.getString("report").toString()
                ReportCommitPage(navHostController = navHostController, json = report)
            }
            composable(RoutePath.SIGN) { SignListPage(navHostController = navHostController) }
            composable(RoutePath.SIGN_COMMIT) { SignCommitPage(navHostController = navHostController) }
            composable(RoutePath.REGISTER) { RegisterPage(navHostController = navHostController) }
            composable(RoutePath.LOGIN) { LoginPage(navHostController = navHostController) }
            composable(RoutePath.ADD_EMPLOYEE) { AddEmployeePage(navHostController = navHostController) }
            composable(RoutePath.ADD_APPROVE) { AddApprovePage(navHostController = navHostController) }
            composable(RoutePath.APPROVE_LIST) { ApproveListPage(navHostController = navHostController) }
            composable(RoutePath.APPROVE + "/{approve}") {
                val approve = it.arguments?.getString("approve").toString()
                ApprovePage(navHostController = navHostController, json = approve)
            }
            composable(RoutePath.COM_APPROVE + "/{approve}") {
                val approve = it.arguments?.getString("approve").toString()
                ComApprovePage(navHostController = navHostController, json = approve)
            }
            composable(RoutePath.COM_APPROVE_LIST) { ComApproveListPage(navHostController = navHostController) }
            composable(RoutePath.VIDEO) { VideoPage() }
            composable(RoutePath.CONTACT) { ContactPage(navHostController = navHostController) }
            composable(RoutePath.CHAT + "/{chat}") {
                val chat = it.arguments?.getString("chat").toString()
                ChatPage(navHostController = navHostController, json = chat)
            }
            composable(RoutePath.GROUP) { GroupPage(navHostController = navHostController) }
            composable(RoutePath.CREATE_GROUP) { CreateGroupPage(navHostController = navHostController) }
        })
}